There exists a technique for representing numerical values with, for example, variable-length bit representations. When numerical values are represented by variable-length bit representation, a code length of data representing a numerical value is determined according to the magnitude and the number of significant figures, of the numerical value. For example, if a bit representation of a numerical value is in n-bit units, and the head “m” bits of data representing the numerical value correspond to the number of significant figures; the numerical value is able to be represented with “2m−1” digits of base-2n. For example, a case will be considered, where a numerical value is represented; with a bit representation of the numerical value being in 3-bit units (base-8), and the head three bits of data representing the numerical value corresponding to the number of significant figures. Numerical values, “0” to “7”, are each able to be represented by a single octal digit. Therefore, a code length in total of the data representing each of the numerical values, “0” to “7”, is six bits including: the head three bits (001) with the number of significant figures being one digit; and three bits of its numerical portion. If the number of significant figures is seven, a 7-digit numerical value is able to be represented by octal representation. A code length in total of data representing a 7-digit octal numerical value is 24 bits including: the head three bits (111) with the number of significant figures being seven; and 21 bits of its numerical portion.
Patent Literature 1: Japanese Laid-open Patent Publication No. 07-273661
Patent Literature 2: Japanese Laid-open Patent Publication No. 63-269623
In general, the appearance frequency, at which a numerical value appears in a document or the like, tends to be inversely proportional to the magnitude of the numerical value. For example, the appearance frequency of a one-digit numerical value, such as “1”, is high, and the larger the number of digits of a numerical value is, the lower its appearance frequency is. Therefore, if a small numerical value is able to be represented by a short code length, its data are able to be compressed small.
However, with the above described conventional technique, since data of a compressed numerical value are added with “m” bits indicating the number of significant figures, a code length of a small numerical value becomes long, and thus data may be unable to be compressed at a high compression rate.